<template>
  <div>
    <input type="text" v-model="form.phone" />
    <input type="text" v-model="form.nickname" />
    <input type="text" v-model="form.password" />
    <button @click="useradd">登入</button>
  </div>
</template>
<script>
import { userregister } from "../../requset/api";
import { successAlert, warningAlert } from "../../util/alert.js";
export default {
  data() {
    return {
      form: {
        phone: "",
        nickname: "",
        password: "",
      },
    };
  },
  methods: {
    useradd() {
      userregister(this.form).then((res) => {
        if (res.data.code == 200) {
          successAlert(res.data.msg);
        } else {
          warningAlert(res.data.msg);
        }
      });
    },
  },
  components: {},
  mounted() {},
  destroyed() {},
};
</script>
<style>
</style>